package com.ylkj.user.services.impl;

import com.ylkj.core.page.IGenericPage;
import com.ylkj.user.dao.AdminDao;
import com.ylkj.user.dao.UserDao;
import com.ylkj.user.model.TalentAdmin;
import com.ylkj.user.model.User;
import com.ylkj.user.services.AdminService;
import com.ylkj.user.services.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service("adminService")
public class AdminServiceImpl implements AdminService {

    @Autowired
    private AdminDao adminDao;

    @Override
    public int save(TalentAdmin ob) throws Exception {
        return adminDao.save(ob);
    }

    @Override
    public TalentAdmin getById(Long id) {
        return adminDao.getById(id);
    }

    @Override
    public TalentAdmin getByUid(String uid) {
        return adminDao.getByUid(uid);
    }

    @Override
    public TalentAdmin getByMobile(String mobile) {
        return adminDao.getByMobile(mobile);
    }

    @Override
    public int update(TalentAdmin ob) throws Exception {
        return adminDao.update(ob);
    }

    @Override
    public int deleteById(Long id) throws Exception {
        //清除用户角色关联
        adminDao.deleteById(id);
        return 1;
    }

    @Override
    public int deleteByUId(String uid) throws Exception {
        //清除用户角色关联
        adminDao.deleteByUId(uid);
        return 1;
    }

    @Override
    public IGenericPage<TalentAdmin> findPageBy(TalentAdmin param, int pageNo, int pageSize, String sort, String dir) {
        return adminDao.findPageBy(param, pageNo, pageSize, sort, dir);
    }

    @Override
    public Integer getCountBy(TalentAdmin param) {
        return adminDao.getCountBy(param);
    }

    @Override
    public List<TalentAdmin> findListBy(TalentAdmin param, String sort, String dir) {
        return adminDao.findListBy(param, sort, dir);
    }

    @Override
    public List<Object> findListByMapData(TalentAdmin param,String sort, String dir) {
        List returnList= new ArrayList();

        List list0= new ArrayList();
        List list1= new ArrayList();
        List list2= new ArrayList();
        List list3= new ArrayList();
        List list4= new ArrayList();
        List list5= new ArrayList();

        List<TalentAdmin> list = adminDao.findListBy(param,sort, dir);

        return returnList;
    }
}
